package com.zky;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

import java.util.Arrays;

@SpringBootApplication
//配置mapper的路径
@MapperScan("com.zky.mapper")
public class MyApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(MyApplication.class, args);
        ConfigurableEnvironment environment = context.getEnvironment();
        // 打印当前激活的 profiles
        System.out.println("Active Profiles: " + Arrays.toString(environment.getActiveProfiles()));

        // 打印服务器端口
        System.out.println("Server Port: " + environment.getProperty("server.port"));

        // 打印 Spring 应用名
        System.out.println("Spring Application Name: " + environment.getProperty("spring.application.name"));

    }
}
